package com.neihe.common.base;

import lombok.Getter;

/**
 * Http状态返回枚举
 */
@Getter
public enum ResultCode {

    SUCCESS(0, "操作成功"),

    VALIDATE_FAILED(40000, "请求参数错误"),

    REQUEST_MODE_ERROR(40001, "请求方式不支持"),

    NOT_LOGIN_ERROR(40100, "未授权"),

    NO_AUTH_ERROR(40101, "无权限操作"),

    NOT_FOUND_ERROR(40400, "请求数据不存在"),

    FORBIDDEN_ERROR(40300, "禁止访问"),

    BAN_ACCESS(40301, "访问频繁，请稍后重试"),

    NEED_EXPAND(40302, "空间容量不足，请扩容"),

    SHARE_FILE_MISS(40303, "分享的文件丢失"),

    SHARE_CANCELLED(40304, "分享已经被取消"),

    SHARE_EXPIRE(40305, "分享已过期"),

    FAILED(50000, "操作失败"),

    ERROR(50001, "未知错误，请联系管理员");

    /**
     * 状态
     */
    private final Integer code;

    /**
     * 信息
     */
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
